//
//  ColorManager.m
//  OC6_字典&集合课后作业color练习
//
//  Created by dllo on 15/10/31.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "ColorManager.h"
#import "Color.h"

@implementation ColorManager

- (id)init
{
    self = [super init];
    if (self) {
        [self setData:[[NSMutableDictionary alloc] init]];
    }
    return self;
}

- (void)addColor:(NSString *)colorName colorValue:(NSString *)colorValue
{
    NSString *key = [colorName substringToIndex:1];
    NSMutableArray *arr = [[NSMutableArray alloc]initWithObjects:colorName, colorValue, nil];
    NSMutableArray *arr1 = nil;
    if (nil == [[self data] objectForKey:key]) {
        arr1 = [NSMutableArray array];
        [[self data] setObject:arr1 forKey:key];
    }else{
        arr1 = [[self data] objectForKey:key];
    }
    [arr1 addObject:arr];
}

// 选取字符打印查看

- (void)test:(NSString *)key
{
    NSLog(@"%@", [[self data] objectForKey:key]);
}




@end
